package feizhou.untils.tools.json;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.type.CollectionType;
import feizhou.untils.tools.StringUtil;
import feizhou.untils.tools.json.bean.FieldMappingBean;
import feizhou.untils.tools.json.bean.FieldMappingTree;
import feizhou.untils.tools.json.bean.JsonNodeBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Json转换工具类
 *
 * @author <a href="920786312@qq.com">周飞</a>
 * @since 2023/8/17 15:07
 */
public class JSONUtil {

    private static Logger log = LoggerFactory.getLogger(JSONUtil.class);
    private static ObjectMapper objectMapper;


    static {
        objectMapper = new ObjectMapper()
                // Include.NON_NULL 属性为NULL 不序列化
                .setSerializationInclusion(JsonInclude.Include.NON_NULL)
                // 设置输入时忽略在JSON字符串中存在但Java对象实际没有的属性
                .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
                .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);

        SimpleModule module = new SimpleModule();
        objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
        objectMapper.registerModule(module);
    }

    private JSONUtil() {

    }

    /**
     * Object 转 Json字符串
     *
     * @param obj
     * @return java.lang.String
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/8/17 14:50
     */
    public static String toJsonStr(Object obj) {
        try {
            return objectMapper.writeValueAsString(obj);
        } catch (JsonProcessingException e) {
            log.warn("obj to json failed:" + obj, e);
            throw new RuntimeException("obj to json failed!!!", e);
        }
    }

    /**
     * jsonString 转readNode
     *
     * @param jsonString
     * @return com.fasterxml.jackson.databind.JsonNode
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/1 10:37
     */
    public static JsonNode readNode(String jsonString) {
        try {
            return objectMapper.readTree(jsonString);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return null;
    }

    /**
     * map 转readNode
     *
     * @param map
     * @return com.fasterxml.jackson.databind.JsonNode
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/1 10:37
     */
    public static JsonNode readNode(Map<String, Object> map) {
        return readNode(toJsonStr(map));
    }

    /**
     * list 转readNode
     *
     * @param list
     * @return com.fasterxml.jackson.databind.JsonNode
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/1 10:37
     */
    public static JsonNode readNode(List list) {
        return readNode(toJsonStr(list));
    }

    /**
     * Json 转 Set
     *
     * @param jsonStr
     * @param clazz
     * @return java.util.Set<T>
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/8/17 14:50
     */
    public static <T> Set<T> toSet(String jsonStr, Class<T> clazz) {
        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }
        CollectionType ct = objectMapper.getTypeFactory().constructCollectionType(HashSet.class, clazz);
        try {
            Set<T> arr = objectMapper.readValue(jsonStr, ct);
            return arr;
        } catch (Exception e) {
            log.error("Json to Set error", e);
        }
        return null;
    }

    /**
     * to List
     *
     * @param jsonStr
     * @param clazz
     * @return java.util.List<T>
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/8/17 14:51
     */
    public static <T> List<T> toList(String jsonStr, Class<T> clazz) {
        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }

        CollectionType ct = objectMapper.getTypeFactory().constructCollectionType(List.class, clazz);
        try {
            List<T> arr = objectMapper.readValue(jsonStr, ct);
            return arr;
        } catch (Exception e) {
            log.error("Json to List error", e);
        }
        return null;
    }

    /**
     * jsonStr 转 类实体
     *
     * @param jsonStr
     * @param clazz
     * @return T
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/8/17 14:52
     */
    /*
     * public static <T> List<T> toList2(String jsonStr, Class<T> clazz) {
     *
     * if (StringUtil.isEmpty(jsonStr)) { return null; }
     *
     * List<T> result = new ArrayList<T>(); try { List<Map<String, Object>> list =
     * objectMapper.readValue(jsonStr, new TypeReference<List<T>>() { }); for
     * (Map<String, Object> map : list) { result.add(map2Pojo(map, clazz)); } }
     * catch (JsonParseException e) { e.printStackTrace(); } catch
     * (JsonMappingException e) { e.printStackTrace(); } catch (IOException e) {
     * e.printStackTrace(); } return result; }
     */
    public static <T> T toEntity(String jsonStr, Class<T> clazz) {
        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }
        T t = null;
        try {
            t = objectMapper.readValue(jsonStr, clazz);
        } catch (Exception e) {
            log.error("Json to Object error ", e);
        }
        return t;
    }

    public static <T> T toEntity(ObjectMapper mapper, String jsonStr, Class<T> clazz) {
        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }
        T t = null;
        try {
            t = mapper.readValue(jsonStr, clazz);
        } catch (Exception e) {
            log.error("Json to Object error ", e);
        }
        return t;
    }

    /**
     * @param jsonStr
     * @param clazz
     * @return
     */
    public static <T> Map<String, T> toMap(String jsonStr, Class<T> clazz) {

        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }

        Map<String, T> map = null;
        try {
            map = objectMapper.readValue(jsonStr, new TypeReference<Map<String, T>>() {
            });
        } catch (Exception e) {
            log.warn(jsonStr + " not a JSON string!! Exception:" + e.getMessage());
        }
        return map;
    }

    /**
     * 复杂Map类型转换
     *
     * @param jsonStr
     * @param mapClass
     * @param keyClass
     * @param valueClass
     * @return
     */
    @SuppressWarnings("rawtypes")
    public static <T> Map<String, T> toMap(String jsonStr, Class<? extends Map> mapClass, Class<?> keyClass,
                                           Class<?> valueClass) {
        Map<String, T> map = null;
        JavaType javaType = contructMapType(mapClass, keyClass, valueClass);
        try {
            map = fromJson(jsonStr, javaType);
        } catch (Exception e) {
            log.warn(jsonStr + " not a JSON string!! Exception:" + e.getMessage());
        }
        return map;
    }

    /**
     * 将JSON转换为对象
     *
     * @param jsonStr
     * @param javaType
     * @return
     */
    public static <T> T fromJson(String jsonStr, JavaType javaType) {

        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }

        try {
            return objectMapper.readValue(jsonStr, javaType);
        } catch (Exception e) {
            log.warn("parse json string error:" + jsonStr, e);
            return null;
        }
    }

    /**
     * 构造Map类型
     *
     * @param mapClass
     * @param keyClass
     * @param valueClass
     * @return
     */
    public static JavaType contructMapType(@SuppressWarnings("rawtypes") Class<? extends Map> mapClass,
                                           Class<?> keyClass, Class<?> valueClass) {
        return objectMapper.getTypeFactory().constructMapType(mapClass, keyClass, valueClass);
    }

    public static ObjectMapper getMapper() {
        return objectMapper;
    }

    /**
     * @param map
     * @param clazz
     * @return
     */
    public static <T> T map2Pojo(Map<?, ?> map, Class<T> clazz) {
        return objectMapper.convertValue(map, clazz);
    }

    public static String serialize(Object obj) throws JsonProcessingException {
        return objectMapper.writeValueAsString(obj);
    }

    public static <T> T deserialize(String jsonString, Class<T> clazz) throws JsonProcessingException {
        return objectMapper.readValue(jsonString, clazz);
    }

    /**
     * Object to Json
     *
     * @param mapper
     * @param obj
     * @return
     */
    public static String toJsonStr(ObjectMapper mapper, Object obj) {
        try {
            return mapper.writeValueAsString(obj);
        } catch (JsonProcessingException e) {
            log.warn("obj to json failed:" + obj, e);
            throw new RuntimeException("obj to json failed!!!", e);
        }
    }


    /**
     * Json to JsonNode
     *
     * @param mapper
     * @param jsonString
     * @return
     */
    public static JsonNode readNode(ObjectMapper mapper, String jsonString) throws JsonProcessingException {
        return mapper.readTree(jsonString);
    }

    /**
     * @param mapper
     * @param jsonStr
     * @param clazz
     * @return
     */
    public static <T> Map<String, T> toMap(ObjectMapper mapper, String jsonStr, Class<T> clazz) {

        if (StringUtil.isEmpty(jsonStr)) {
            return null;
        }

        Map<String, T> map = null;
        try {
            map = mapper.readValue(jsonStr, new TypeReference<Map<String, T>>() {
            });
        } catch (Exception e) {
            log.warn(jsonStr + " not a JSON string!! Exception:" + e.getMessage());
        }
        return map;
    }


    /**
     * 返回节点路径的值，
     * 比如user.info.id=12，路径是：user.info.id，返回就是12
     * 比如user.info.id=12，路径是：user.info，返回id对象的字符串
     *
     * @param keyPath  节点路径，比如 user.info.id
     * @param jsonNode 节点
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/1 10:25
     */
    public static String getValueByKeyPath(String keyPath, JsonNode jsonNode) {
        //获取层数
        String[] keyPathArr = keyPath.split("\\.");

        StringBuilder errNodePath = new StringBuilder();
        //获取最后一层路径对应的value值
        int length = keyPathArr.length;

        //是数组的场景，需要遍历数组的内容,返回逗号间隔的数据
        if (jsonNode.isArray()) {
            StringBuilder sb = new StringBuilder();
            jsonNode.forEach(e -> {
                sb.append(getValueByKeyPath(keyPath, e) + ",");
            });
            return sb.deleteCharAt(sb.length() - 1).toString();
        } else {//非数组的场景
            for (int i = 0; i < length; i++) {
                //节点名称
                String nodeName = keyPathArr[i];
                //错误信息
                errNodePath.append(nodeName + ".");
                jsonNode = jsonNode.get(nodeName);
                //节点不存在情况
                if (jsonNode == null) {
                    return null;
                }
                //最后一层路径
                if (i == length - 1) {
                    // 是叶子节点
                    if (jsonNode.isValueNode()) {
                        return jsonNode.asText();
                    }
                    return jsonNode.toString();
                }
            }
        }

        return null;
    }


    /**
     *
     * 通过字段映射配置，将json 按照规则，转换为另外一个json
     * 注意：是通过fieldMappingBeans生成的json，也就是说只要fieldMappingBeans存在，就一定会生成json，不管srvJson是否存在
     * @param srvJson 原json 字符串
     * @param fieldMappingTrees 字段映射树配置
     * @return 新的json字符串
     * @author  <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/30 10:10
     */
    public static String toJsonStr(JsonNode srvJson, List<FieldMappingTree> fieldMappingTrees) {

        if (srvJson != null && srvJson.isArray()) {
            List<Map> list = new ArrayList<>();
            srvJson.forEach(e -> {
                Map<String, Object> objectMap = JsonNodeBean.buildMap(e, fieldMappingTrees);
                list.add(objectMap);
            });
            return toJsonStr(list);
        }
        Map<String, Object> objectMap = JsonNodeBean.buildMap(srvJson, fieldMappingTrees);
        return toJsonStr(objectMap);
    }

    /**
     *
     * 通过字段映射配置，将json 按照规则，转换为另外一个json
     * 注意：是通过fieldMappingBeans生成的json，也就是说只要fieldMappingBeans存在，就一定会生成json，不管srvJson是否存在
     * @param srvJson 原json 字符串
     * @param fieldMappingBeans 字段映射配置
     * @return 新的json字符串
     * @author  <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/30 10:10
     */
    public static String toJsonStr2(JsonNode srvJson, List<FieldMappingBean> fieldMappingBeans) {
        List<FieldMappingTree> fieldMappingTrees = JsonNodeBean.toFieldMappingTree(fieldMappingBeans);
        return toJsonStr(srvJson, fieldMappingTrees);
    }

    /**
     *
     * 通过字段映射配置，将json 按照规则，转换为另外一个json
     * 注意：是通过fieldMappingBeans生成的json，也就是说只要fieldMappingBeans存在，就一定会生成json，不管srvJson是否存在
     * @param jsonStr 原json 字符串
     * @param fieldMappingBeans 字段映射配置
     * @return 新的json字符串
     * @author  <a href="920786312@qq.com">周飞</a>
     * @since 2023/11/30 10:10
     */
    public static String toJsonStr2(String jsonStr, List<FieldMappingBean> fieldMappingBeans) {
        JsonNode srvJson = StringUtil.isEmpty(jsonStr) ? null : JSONUtil.readNode(jsonStr);
        return toJsonStr2(srvJson, fieldMappingBeans);
    }

    public static void main(String[] args) throws Exception {

//        String jsonStr = "[{\"id\":25882,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"BGM01_GM01000000\",\"name\":\"公司领导\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"BGM01_GM01000000\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":26097,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"BGM01_GM01010000\",\"name\":\"员工\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"BGM01_GM01010000\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34174,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000433\",\"name\":\"品牌市场中心\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000433\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34175,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000408\",\"name\":\"党群工作部\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000408\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34176,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000425\",\"name\":\"平远奶源基地\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000425\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34180,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000414\",\"name\":\"研发中心\",\"weight\":230,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000414\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34190,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000434\",\"name\":\"营销中心\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000434\"},\"pinyin\":\"yingxiaozhongxin\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34191,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000411\",\"name\":\"财务运营部\",\"weight\":230,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000411\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34193,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000416\",\"name\":\"供应链管理部\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000416\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34194,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000413\",\"name\":\"人力资源部\",\"weight\":230,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000413\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34195,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000410\",\"name\":\"投资发展部\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000410\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34196,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000412\",\"name\":\"行政管理部\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000412\"},\"pinyin\":\"xingzhengguanlibu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34201,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000415\",\"name\":\"品质管理部\",\"weight\":230,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000415\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34209,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000426\",\"name\":\"生产加工部\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000426\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34221,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000409\",\"name\":\"纪委办公室\",\"weight\":230,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000409\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34291,\"parentId\":25443,\"tenantId\":\"system\",\"code\":\"D000420\",\"name\":\"奶源发展部\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000420\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34395,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000439\",\"name\":\"重点客户服务部\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000439\"},\"pinyin\":\"zhongdiankehufuwubu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34402,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000448\",\"name\":\"行销部\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000448\"},\"pinyin\":\"xingxiaobu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34404,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000450\",\"name\":\"家订项目组\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000450\"},\"pinyin\":\"jiadingxiangmuzu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34406,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000453\",\"name\":\"校园项目组\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000453\"},\"pinyin\":\"xiaoyuanxiangmuzu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34410,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000443\",\"name\":\"粤东区域\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000443\"},\"pinyin\":\"yuedongquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34411,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000447\",\"name\":\"渠道部\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000447\"},\"pinyin\":\"qudaobu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34412,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000445\",\"name\":\"粤北区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000445\"},\"pinyin\":\"yuebeiquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34415,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000441\",\"name\":\"深圳区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000441\"},\"pinyin\":\"shenzhenquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34419,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000444\",\"name\":\"粤西区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000444\"},\"pinyin\":\"yuexiquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34420,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000452\",\"name\":\"梅汕项目组\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000452\"},\"pinyin\":\"meishanxiangmuzu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34423,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000442\",\"name\":\"东莞区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000442\"},\"pinyin\":\"dongguanquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34437,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000451\",\"name\":\"江珠项目组\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000451\"},\"pinyin\":\"jiangzhuxiangmuzu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34444,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000449\",\"name\":\"品类管理部\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000449\"},\"pinyin\":\"pinleiguanlibu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34465,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000446\",\"name\":\"广佛区域\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000446\"},\"pinyin\":\"guangfoquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34514,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000437\",\"name\":\"新业务发展部\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000437\"},\"pinyin\":\"xinyewufazhanbu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34515,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000435\",\"name\":\"营销中心办公室\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000435\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34520,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000438\",\"name\":\"重点客户执行部\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000438\"},\"pinyin\":\"zhongdiankehuzhixingbu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34528,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000440\",\"name\":\"省外区域\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000440\"},\"pinyin\":\"shengwaiquyu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34529,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D000436\",\"name\":\"新零售发展部\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D000436\"},\"pinyin\":\"xinlingshoufazhanbu\",\"propertyNames\":[\"app\",\"leadDepart\",\"lev\",\"synId\"]},{\"id\":37195,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D006385\",\"name\":\"现代渠道运营部\",\"description\":\"\",\"weight\":240,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006385\"},\"pinyin\":\"xiandaiqudaoyunyingbu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37196,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D006387\",\"name\":\"广东大区\",\"description\":\"\",\"weight\":240,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006387\"},\"pinyin\":\"guangdongdaqu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37197,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D006388\",\"name\":\"销售运作管理部\",\"description\":\"\",\"weight\":240,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006388\"},\"pinyin\":\"xiaoshouyunzuoguanlibu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37198,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D006386\",\"name\":\"省外大区\",\"description\":\"\",\"weight\":240,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006386\"},\"pinyin\":\"shengwaidaqu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37199,\"parentId\":34190,\"tenantId\":\"system\",\"code\":\"D006389\",\"name\":\"销售支持部\",\"description\":\"\",\"weight\":250,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006389\"},\"pinyin\":\"xiaoshouzhichibu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37217,\"parentId\":34406,\"tenantId\":\"system\",\"code\":\"D006449\",\"name\":\"推广组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006449\"},\"pinyin\":\"tuiguangzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37218,\"parentId\":34406,\"tenantId\":\"system\",\"code\":\"D006450\",\"name\":\"深圳组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006450\"},\"pinyin\":\"shenzhenzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37211,\"parentId\":34529,\"tenantId\":\"system\",\"code\":\"D006379\",\"name\":\"内容运营组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006379\"},\"pinyin\":\"neirongyunyingzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37212,\"parentId\":34529,\"tenantId\":\"system\",\"code\":\"D006380\",\"name\":\"官旗运营组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006380\"},\"pinyin\":\"guanqiyunyingzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37213,\"parentId\":34529,\"tenantId\":\"system\",\"code\":\"D006381\",\"name\":\"自营运营组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006381\"},\"pinyin\":\"ziyingyunyingzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37214,\"parentId\":34529,\"tenantId\":\"system\",\"code\":\"D006384\",\"name\":\"直播运营组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006384\"},\"pinyin\":\"zhiboyunyingzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37215,\"parentId\":34529,\"tenantId\":\"system\",\"code\":\"D006383\",\"name\":\"社团运营组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006383\"},\"pinyin\":\"shetuanyunyingzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37216,\"parentId\":34529,\"tenantId\":\"system\",\"code\":\"D006382\",\"name\":\"生鲜运营组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006382\"},\"pinyin\":\"shengxianyunyingzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37200,\"parentId\":37195,\"tenantId\":\"system\",\"code\":\"D006391\",\"name\":\"重点客户服务部\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006391\"},\"pinyin\":\"zhongdiankehufuwubu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37201,\"parentId\":37195,\"tenantId\":\"system\",\"code\":\"D006390\",\"name\":\"重点客户执行部\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006390\"},\"pinyin\":\"zhongdiankehuzhixingbu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37219,\"parentId\":37200,\"tenantId\":\"system\",\"code\":\"D006396\",\"name\":\"客服二组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006396\"},\"pinyin\":\"kefuerzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37220,\"parentId\":37200,\"tenantId\":\"system\",\"code\":\"D006395\",\"name\":\"客服一组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006395\"},\"pinyin\":\"kefuyizu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37221,\"parentId\":37200,\"tenantId\":\"system\",\"code\":\"D006397\",\"name\":\"客服三组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006397\"},\"pinyin\":\"kefusanzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37222,\"parentId\":37201,\"tenantId\":\"system\",\"code\":\"D006392\",\"name\":\"执行一组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006392\"},\"pinyin\":\"zhixingyizu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37223,\"parentId\":37201,\"tenantId\":\"system\",\"code\":\"D006394\",\"name\":\"执行三组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006394\"},\"pinyin\":\"zhixingsanzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37224,\"parentId\":37201,\"tenantId\":\"system\",\"code\":\"D006393\",\"name\":\"执行二组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006393\"},\"pinyin\":\"zhixingerzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37202,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006410\",\"name\":\"江珠区域\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006410\"},\"pinyin\":\"jiangzhuquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37203,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006409\",\"name\":\"梅汕区域\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006409\"},\"pinyin\":\"meishanquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37204,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006405\",\"name\":\"惠河区域\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006405\"},\"pinyin\":\"huihequyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37205,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006404\",\"name\":\"东莞区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006404\"},\"pinyin\":\"dongguanquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37206,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006406\",\"name\":\"粤西区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006406\"},\"pinyin\":\"yuexiquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37207,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006403\",\"name\":\"深圳区域\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006403\"},\"pinyin\":\"shenzhenquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37208,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006408\",\"name\":\"广佛区域\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006408\"},\"pinyin\":\"guangfoquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37209,\"parentId\":37196,\"tenantId\":\"system\",\"code\":\"D006407\",\"name\":\"粤北区域\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006407\"},\"pinyin\":\"yuebeiquyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37225,\"parentId\":37202,\"tenantId\":\"system\",\"code\":\"D006447\",\"name\":\"珠海办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006447\"},\"pinyin\":\"zhuhaiban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37226,\"parentId\":37202,\"tenantId\":\"system\",\"code\":\"D006446\",\"name\":\"江门办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006446\"},\"pinyin\":\"jiangmenban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37227,\"parentId\":37202,\"tenantId\":\"system\",\"code\":\"D006448\",\"name\":\"中山办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006448\"},\"pinyin\":\"zhongshanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37228,\"parentId\":37203,\"tenantId\":\"system\",\"code\":\"D006443\",\"name\":\"潮汕办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006443\"},\"pinyin\":\"chaoshanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37229,\"parentId\":37203,\"tenantId\":\"system\",\"code\":\"D006445\",\"name\":\"揭阳办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006445\"},\"pinyin\":\"jieyangban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37230,\"parentId\":37203,\"tenantId\":\"system\",\"code\":\"D006444\",\"name\":\"梅州办\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006444\"},\"pinyin\":\"meizhouban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37231,\"parentId\":37204,\"tenantId\":\"system\",\"code\":\"D006426\",\"name\":\"低温惠城办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006426\"},\"pinyin\":\"diwenhuichengban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37232,\"parentId\":37204,\"tenantId\":\"system\",\"code\":\"D006427\",\"name\":\"常温惠城办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006427\"},\"pinyin\":\"changwenhuichengban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37233,\"parentId\":37204,\"tenantId\":\"system\",\"code\":\"D006428\",\"name\":\"惠阳办\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006428\"},\"pinyin\":\"huiyangban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37234,\"parentId\":37204,\"tenantId\":\"system\",\"code\":\"D006431\",\"name\":\"龙川办\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006431\"},\"pinyin\":\"longchuanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37235,\"parentId\":37204,\"tenantId\":\"system\",\"code\":\"D006430\",\"name\":\"河源办\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006430\"},\"pinyin\":\"heyuanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37236,\"parentId\":37204,\"tenantId\":\"system\",\"code\":\"D006429\",\"name\":\"博罗办\",\"description\":\"\",\"weight\":240,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006429\"},\"pinyin\":\"boluoban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37237,\"parentId\":37205,\"tenantId\":\"system\",\"code\":\"D006421\",\"name\":\"常温长虎办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006421\"},\"pinyin\":\"changwenzhanghuban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37238,\"parentId\":37205,\"tenantId\":\"system\",\"code\":\"D006423\",\"name\":\"低温家订办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006423\"},\"pinyin\":\"diwenjiadingban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37239,\"parentId\":37205,\"tenantId\":\"system\",\"code\":\"D006424\",\"name\":\"低温流通办\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006424\"},\"pinyin\":\"diwenliutongban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37240,\"parentId\":37205,\"tenantId\":\"system\",\"code\":\"D006425\",\"name\":\"商超办\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006425\"},\"pinyin\":\"shangchaoban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37241,\"parentId\":37205,\"tenantId\":\"system\",\"code\":\"D006422\",\"name\":\"常温莞城办\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006422\"},\"pinyin\":\"changwenguanchengban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37242,\"parentId\":37206,\"tenantId\":\"system\",\"code\":\"D006432\",\"name\":\"阳江办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006432\"},\"pinyin\":\"yangjiangban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37243,\"parentId\":37206,\"tenantId\":\"system\",\"code\":\"D006433\",\"name\":\"湛江办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006433\"},\"pinyin\":\"zhanjiangban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37244,\"parentId\":37206,\"tenantId\":\"system\",\"code\":\"D006434\",\"name\":\"茂名办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006434\"},\"pinyin\":\"maomingban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37245,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006413\",\"name\":\"常温龙岗办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006413\"},\"pinyin\":\"changwenlonggangban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37246,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006412\",\"name\":\"常温宝安办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006412\"},\"pinyin\":\"changwenbaoanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37247,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006415\",\"name\":\"低温市区办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006415\"},\"pinyin\":\"diwenshiquban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37248,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006411\",\"name\":\"常温市区办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006411\"},\"pinyin\":\"changwenshiquban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37249,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006414\",\"name\":\"常温商超办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006414\"},\"pinyin\":\"changwenshangchaoban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37250,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006416\",\"name\":\"低温宝安办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006416\"},\"pinyin\":\"diwenbaoanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37251,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006418\",\"name\":\"低温商超办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006418\"},\"pinyin\":\"diwenshangchaoban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37252,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006419\",\"name\":\"特渠办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006419\"},\"pinyin\":\"tequban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37253,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006420\",\"name\":\"家订项目组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006420\"},\"pinyin\":\"jiadingxiangmuzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37254,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D006417\",\"name\":\"低温龙岗办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006417\"},\"pinyin\":\"diwenlonggangban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37255,\"parentId\":37207,\"tenantId\":\"system\",\"code\":\"D007043\",\"name\":\"低温校园办\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D007043\"},\"pinyin\":\"diwenxiaoyuanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37256,\"parentId\":37208,\"tenantId\":\"system\",\"code\":\"D006438\",\"name\":\"黄埔办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006438\"},\"pinyin\":\"huangpuban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37257,\"parentId\":37208,\"tenantId\":\"system\",\"code\":\"D006441\",\"name\":\"荔湾办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006441\"},\"pinyin\":\"liwanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37258,\"parentId\":37208,\"tenantId\":\"system\",\"code\":\"D006440\",\"name\":\"海珠办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006440\"},\"pinyin\":\"haizhuban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37259,\"parentId\":37208,\"tenantId\":\"system\",\"code\":\"D006439\",\"name\":\"白云办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006439\"},\"pinyin\":\"baiyunban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37260,\"parentId\":37208,\"tenantId\":\"system\",\"code\":\"D006442\",\"name\":\"三水办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006442\"},\"pinyin\":\"sanshuiban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37261,\"parentId\":37209,\"tenantId\":\"system\",\"code\":\"D006435\",\"name\":\"清远办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006435\"},\"pinyin\":\"qingyuanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37262,\"parentId\":37209,\"tenantId\":\"system\",\"code\":\"D006437\",\"name\":\"韶关办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006437\"},\"pinyin\":\"shaoguanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37263,\"parentId\":37209,\"tenantId\":\"system\",\"code\":\"D006436\",\"name\":\"云肇办\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006436\"},\"pinyin\":\"yunzhaoban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37210,\"parentId\":37197,\"tenantId\":\"system\",\"code\":\"D006451\",\"name\":\"渠道部\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006451\"},\"pinyin\":\"qudaobu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37264,\"parentId\":37197,\"tenantId\":\"system\",\"code\":\"D006453\",\"name\":\"数字运营部\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006453\"},\"pinyin\":\"shuziyunyingbu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37265,\"parentId\":37197,\"tenantId\":\"system\",\"code\":\"D006452\",\"name\":\"行销部\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006452\"},\"pinyin\":\"xingxiaobu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37266,\"parentId\":37210,\"tenantId\":\"system\",\"code\":\"D006454\",\"name\":\"推广组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006454\"},\"pinyin\":\"tuiguangzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37267,\"parentId\":37198,\"tenantId\":\"system\",\"code\":\"D006399\",\"name\":\"福建\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006399\"},\"pinyin\":\"fujian\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37268,\"parentId\":37198,\"tenantId\":\"system\",\"code\":\"D006402\",\"name\":\"成渝\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006402\"},\"pinyin\":\"chengyu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37269,\"parentId\":37198,\"tenantId\":\"system\",\"code\":\"D006401\",\"name\":\"江西\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006401\"},\"pinyin\":\"jiangxi\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37270,\"parentId\":37198,\"tenantId\":\"system\",\"code\":\"D006400\",\"name\":\"湖南\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006400\"},\"pinyin\":\"hunan\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37271,\"parentId\":37198,\"tenantId\":\"system\",\"code\":\"D006398\",\"name\":\"江浙\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006398\"},\"pinyin\":\"jiangzhe\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37272,\"parentId\":37199,\"tenantId\":\"system\",\"code\":\"D006457\",\"name\":\"售后服务组\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006457\"},\"pinyin\":\"shouhoufuwuzu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37273,\"parentId\":37199,\"tenantId\":\"system\",\"code\":\"D006456\",\"name\":\"产销协调组\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006456\"},\"pinyin\":\"chanxiaoxiediaozu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37274,\"parentId\":37199,\"tenantId\":\"system\",\"code\":\"D006458\",\"name\":\"督查组\",\"description\":\"\",\"weight\":220,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006458\"},\"pinyin\":\"duchazu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37275,\"parentId\":37199,\"tenantId\":\"system\",\"code\":\"D006455\",\"name\":\"行政管理组\",\"description\":\"\",\"weight\":230,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006455\"},\"pinyin\":\"xingzhengguanlizu\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":34387,\"parentId\":34193,\"tenantId\":\"system\",\"code\":\"D000418\",\"name\":\"PMC室\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000418\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34390,\"parentId\":34193,\"tenantId\":\"system\",\"code\":\"D000419\",\"name\":\"仓储物流室\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000419\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34472,\"parentId\":34193,\"tenantId\":\"system\",\"code\":\"D000417\",\"name\":\"采购室\",\"weight\":220,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000417\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":37193,\"parentId\":34196,\"tenantId\":\"system\",\"code\":\"D006377\",\"name\":\"安环办\",\"description\":\"\",\"weight\":200,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006377\"},\"pinyin\":\"anhuanban\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":37194,\"parentId\":34196,\"tenantId\":\"system\",\"code\":\"D006378\",\"name\":\"数字化发展办公室\",\"description\":\"\",\"weight\":210,\"props\":{\"app\":\"\",\"lev\":\"DEPARTMENT\",\"synId\":\"D006378\"},\"pinyin\":\"shuzihuafazhanbangongshi\",\"propertyNames\":[\"app\",\"lev\",\"synId\"]},{\"id\":34484,\"parentId\":34209,\"tenantId\":\"system\",\"code\":\"D000432\",\"name\":\"纸包车间\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000432\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34487,\"parentId\":34209,\"tenantId\":\"system\",\"code\":\"D000430\",\"name\":\"鲜奶车间\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000430\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34495,\"parentId\":34209,\"tenantId\":\"system\",\"code\":\"D000429\",\"name\":\"机修车间\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000429\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34512,\"parentId\":34209,\"tenantId\":\"system\",\"code\":\"D000428\",\"name\":\"动力车间\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000428\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34519,\"parentId\":34209,\"tenantId\":\"system\",\"code\":\"D000431\",\"name\":\"酸奶车间\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000431\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34587,\"parentId\":34209,\"tenantId\":\"system\",\"code\":\"D000427\",\"name\":\"生产加工办公室\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000427\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34551,\"parentId\":34291,\"tenantId\":\"system\",\"code\":\"D000422\",\"name\":\"生产技术部\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000422\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34558,\"parentId\":34291,\"tenantId\":\"system\",\"code\":\"D000423\",\"name\":\"新陂头牛场\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000423\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34609,\"parentId\":34291,\"tenantId\":\"system\",\"code\":\"D000421\",\"name\":\"综合办公室\",\"weight\":200,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000421\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]},{\"id\":34641,\"parentId\":34291,\"tenantId\":\"system\",\"code\":\"D000424\",\"name\":\"龙门奶源基地\",\"weight\":210,\"props\":{\"lev\":\"DEPARTMENT\",\"synId\":\"D000424\"},\"propertyNames\":[\"leadDepart\",\"lev\",\"synId\"]}]";
//        JsonNode jsonNode = JSONUtil.readNode(jsonStr);
//        List<FieldMappingTree> list = new ArrayList<>();
//        list.add(new FieldMappingTree("id", "id", null,null,null,null));
//        list.add(new FieldMappingTree("text", "name", null,null,null,null));

        JsonNode jsonNode = null;
        List<FieldMappingTree> list = new ArrayList<>();
        list.add(new FieldMappingTree("id", null, null, "1", null, null, null, null));
        list.add(new FieldMappingTree("text", null, null, "2", null, null, null, null));

        String newjson = toJsonStr(jsonNode, list);

        System.out.println(newjson);
    }


}
